﻿Imports System.Text

<TestClass()>
Public Class SQLDataProviderInstallTest

    <TestMethod()>
    Public Sub TestCreateDropScripts_00_00_01()
        Dim scriptExecuter As New ContactsScriptExecuter

        scriptExecuter.ExecuteCreateScript()
        scriptExecuter.ExecuteCreateScript()
        Assert.AreEqual(True, UnitTestCore.DatabaseTableExists("Geminorum_Contact"))
        Assert.AreEqual(True, UnitTestCore.StoredProcedureExists("Geminorum_Contact_Insert"))
        Assert.AreEqual(True, UnitTestCore.StoredProcedureExists("Geminorum_Contact_SelectByID"))
        Assert.AreEqual(True, UnitTestCore.StoredProcedureExists("Geminorum_Contact_SelectByModuleID"))
        Assert.AreEqual(True, UnitTestCore.StoredProcedureExists("Geminorum_Contact_Update"))
        Assert.AreEqual(True, UnitTestCore.StoredProcedureExists("Geminorum_Contact_DeleteByID"))
        Assert.AreEqual(True, UnitTestCore.StoredProcedureExists("Geminorum_Contact_DeleteByModuleID"))

        scriptExecuter.ExecuteDropScript()
        Assert.AreEqual(False, UnitTestCore.DatabaseTableExists("Geminorum_Contact"))
        Assert.AreEqual(False, UnitTestCore.StoredProcedureExists("Geminorum_Contact_Insert"))
        Assert.AreEqual(False, UnitTestCore.StoredProcedureExists("Geminorum_Contact_SelectByID"))
        Assert.AreEqual(False, UnitTestCore.StoredProcedureExists("Geminorum_Contact_SelectByModuleID"))
        Assert.AreEqual(False, UnitTestCore.StoredProcedureExists("Geminorum_Contact_Update"))
        Assert.AreEqual(False, UnitTestCore.StoredProcedureExists("Geminorum_Contact_DeleteByID"))
        Assert.AreEqual(False, UnitTestCore.StoredProcedureExists("Geminorum_Contact_DeleteByModuleID"))

        'should not throw any exceptions
        scriptExecuter.ExecuteDropScript()
    End Sub

End Class